﻿Imports omen02
Public Class InsertarPedido



    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
        Me.Visible = False
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


        'Ingresar los datos a la base de datos
        Dim x = Me.idpaqregistrarpedido.Text

        Dim y = Me.iduseregistrarpedido.Text

        Dim z = Me.descripcionregistrarpedido.Text


        Dim n = New PedidoNegocio()



        Dim paquete = n.insertar(x, y, z)

        MsgBox("Pedido registrado!!!!")

        'Limpiar cajitas de texto desues de ingresar datos
        idpaqregistrarpedido.Clear()
        iduseregistrarpedido.Clear()
        descripcionregistrarpedido.Clear()

    End Sub

    Private Sub idpaqregistrarpedido_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)


    End Sub

    Private Sub Listar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Listar.Click

        Dim negocio As New PedidoNegocio

        Dim pedidos As Collection = negocio.listar()
        Me.dgvpaquete.DataSource = pedidos
        Me.dgvpaquete.EditMode = False

        Me.dgvpaquete.Columns(0).HeaderText = "idPedido"
        Me.dgvpaquete.Columns(1).HeaderText = "idPaquete"
        Me.dgvpaquete.Columns(2).HeaderText = "idUsuario"
        Me.dgvpaquete.Columns(3).HeaderText = "promocion"



    End Sub

    Private Sub dgvpedido_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvpaquete.CellContentClick

    End Sub


End Class